﻿namespace com.binance.client.model.trade
{
	using BinanceApiConstants = com.binance.client.constant.BinanceApiConstants;
	using ToStringBuilder = org.apache.commons.lang3.builder.ToStringBuilder;


	/** <summary>
	  "positions": [  // 头寸，将返回所有市场symbol。
	    //根据用户持仓模式展示持仓方向，即双向模式下只返回BOTH持仓情况，单向模式下只返回 LONG 和 SHORT 持仓情况
        {
            "symbol": "BTCUSDT",  // 交易对
            "initialMargin": "0",   // 当前所需起始保证金(基于最新标记价格)
            "maintMargin": "0", //维持保证金
            "unrealizedProfit": "0.00000000",  // 持仓未实现盈亏
            "positionInitialMargin": "0",  // 持仓所需起始保证金(基于最新标记价格)
            "openOrderInitialMargin": "0",  // 当前挂单所需起始保证金(基于最新标记价格)
            "leverage": "100",  // 杠杆倍率
            "isolated": true,  // 是否是逐仓模式
            "entryPrice": "0.00000",  // 持仓成本价
            "maxNotional": "250000",  // 当前杠杆下用户可用的最大名义价值
            "positionSide": "BOTH",  // 持仓方向
            "positionAmt": "0"      // 持仓数量
        }
    ]
	</summary>
	 */
	public class Position
	{

		private bool? isolated;

		private decimal leverage;

		private decimal initialMargin;

		private decimal maintMargin;

		private decimal openOrderInitialMargin;

		private decimal positionInitialMargin;

		private string symbol;

		private decimal unrealizedProfit;


		private string maxNotional;

		private string positionSide;

		public  decimal positionAmt { get; set; }
		public virtual bool? Isolated
		{
			get
			{
				return isolated;
			}
			set
			{
				this.isolated = value;
			}
		}


		public virtual decimal Leverage
		{
			get
			{
				return leverage;
			}
			set
			{
				this.leverage = value;
			}
		}


		public virtual decimal InitialMargin
		{
			get
			{
				return initialMargin;
			}
			set
			{
				this.initialMargin = value;
			}
		}


		public virtual decimal MaintMargin
		{
			get
			{
				return maintMargin;
			}
			set
			{
				this.maintMargin = value;
			}
		}


		public virtual decimal OpenOrderInitialMargin
		{
			get
			{
				return openOrderInitialMargin;
			}
			set
			{
				this.openOrderInitialMargin = value;
			}
		}


		public virtual decimal PositionInitialMargin
		{
			get
			{
				return positionInitialMargin;
			}
			set
			{
				this.positionInitialMargin = value;
			}
		}


		public virtual string Symbol
		{
			get
			{
				return symbol;
			}
			set
			{
				this.symbol = value;
			}
		}


		public virtual decimal UnrealizedProfit
		{
			get
			{
				return unrealizedProfit;
			}
			set
			{
				this.unrealizedProfit = value;
			}
		}


		public virtual decimal EntryPrice
		{
			get;set;
		}


		public virtual string MaxNotional
		{
			get
			{
				return maxNotional;
			}
			set
			{
				this.maxNotional = value;
			}
		}


		public virtual string PositionSide
		{
			get
			{
				return positionSide;
			}
			set
			{
				this.positionSide = value;
			}
		}


		public override string ToString()
		{
			return (new ToStringBuilder(this, BinanceApiConstants.TO_STRING_BUILDER_STYLE)).append("initialMargin", initialMargin).append("maintMargin", maintMargin).append("openOrderInitialMargin", openOrderInitialMargin).append("positionInitialMargin", positionInitialMargin).append("symbol", symbol).append("unrealizedProfit", unrealizedProfit).append("entryPrice", EntryPrice).append("maxNotional", maxNotional).append("positionSide", positionSide).append("isolated", isolated).ToString();
		}
	}

}